/**
 * 游戏手柄控制器常量定义
 */

// 模式常量
export const MODE_GAMEPAD = 1; // 游戏手柄模式
export const MODE_VIRTUAL_POINTER = 2; // 虚拟指针模式
export const MODE_EDIT_CONFIG = 3; // 编辑配置模式
export const MODE_GUIDE = 5; // 操作指引模式

// 状态常量
export const STATE_INITIALIZED = 0; // 已初始化
export const STATE_RUNNING = 1; // 运行中
export const STATE_DISCONNECTED = 3; // 已断开连接
export const STATE_STOPPED = 4; // 已停止

// 按钮常量
export const BUTTON_BACK = 8;
export const BUTTON_A = 0;
export const BUTTON_B = 1;
export const BUTTON_START = 9;
export const BUTTON_X = 2;
export const BUTTON_Y = 3;
export const BUTTON_LB = 4;
export const BUTTON_RB = 5;
export const BUTTON_LT = 6;
export const BUTTON_RT = 7;
export const BUTTON_LS = 10;
export const BUTTON_RS = 11;

// 方向键常量
const BUTTON_UP = 12;
const BUTTON_DOWN = 13;
const BUTTON_LEFT = 14;
const BUTTON_RIGHT = 15;

export const BUTTON_LABELS = {
  [BUTTON_A]: 'A',
  [BUTTON_B]: 'B',
  [BUTTON_X]: 'X',
  [BUTTON_Y]: 'Y',
  [BUTTON_LB]: 'LB',
  [BUTTON_RB]: 'RB',
  [BUTTON_LT]: 'LT',
  [BUTTON_RT]: 'RT',
  [BUTTON_BACK]: 'Back',
  [BUTTON_START]: 'Start',
  [BUTTON_LS]: 'LS',
  [BUTTON_RS]: 'RS',
  [BUTTON_UP]: '↑',
  [BUTTON_DOWN]: '↓',
  [BUTTON_LEFT]: '←',
  [BUTTON_RIGHT]: '→'
};